package com.atguigu.gmall.order.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.order.client.impl.OrderDegradeFeignClient;
import com.atguigu.gmall.order.model.OrderInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author: 小兰
 * @Date: 2023/5/6 22:06
 */
@FeignClient(value = "service-order", fallback = OrderDegradeFeignClient.class,path = "/api/order")
public interface OrderFeignClient {
    /**
     * 汇总渲染订单确认页面所选的数据   todo :fegin接口是新的http请求,不需要携带参数类型HttpServletRequest
     * @return
     */
    @GetMapping("/auth/trade")
    //**注意:Feign接口方法参数不需要设置参数HttpServletRequest**
    //因为远程调用,不是同一个request
    public Result orderTrade();

    /**
     * 根据订单ID查询订单信息 包含订单明细
     * @param orderId
     * @return
     */
    @GetMapping("/inner/getOrderInfo/{orderId}")
    public OrderInfo getOrderInfoById(@PathVariable("orderId")Long orderId);
}
